const optionsDefault = {
  id: "123",
  name: "张三",
  age: 99,
  age1: false,
  age2: 99,
  age3: 99,
  age4: 99,
  age5: 99,
  age7: 99,
  age6: 99,
  age8: 99,
  age9: 99,
};
// export function doApiSomething(obj: Partial<typeof objDefault>) {
export function doApiSomething(option?: Partial<typeof optionsDefault>) {
  option = option || {};
  const realOptions = { ...optionsDefault, ...option };
  // do something

  console.log(realOptions);
}

interface callbackArgs1 {
  type: string;
  code: string;
  name: string;
}
interface callbackArgs2 {
  type: string;
  idcard: string;
}

interface options {
  callback?: (obj: callbackArgs1 | callbackArgs2) => void;
  name?: string;
  code?: number;
}

export function doSomething(opt: options) {
  return new Promise(resolve => {
    resolve(1);
  });
  // $emit
}

doSomething({
  callback: obj => {},
});
